﻿<UserControl x:Class="ISRecord.View.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:p="clr-namespace:ISRecord.View.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="383" d:DesignWidth="835" Style="{StaticResource UserControlStyle}">

    <DockPanel >
        <ToolBar Margin="3.5" DockPanel.Dock="Top" >
            <Button Content="{StaticResource SaveImage}" Command="{Binding SaveCommand}" Margin="3.5"/>
            <Button Content="{StaticResource ResetImage}" Command="{Binding ResetCommand}" Margin="3.5"/>
        </ToolBar>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0450*"/>
                <ColumnDefinition Width="0450*"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Margin="3.5" Padding="10">
                <StackPanel>
                    <Grid >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Expander Header="{x:Static p:Resources.YearInfoOptionslbl}" IsExpanded="True"
                      Margin="3.5" Grid.Row="0" >
                            <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Padding="10">
                                <Grid >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock HorizontalAlignment="Left" Margin="3.5" 
                           Text="{x:Static p:Resources.Yearlbl}" VerticalAlignment="Center" Grid.Column="0" OverridesDefaultStyle="False" />
                                    <TextBox HorizontalAlignment="Left" Margin="3.5" 
                         Text="{Binding Path=ActiveYear, UpdateSourceTrigger=PropertyChanged}"  
                         VerticalAlignment="Center" MinWidth="200" Grid.Column="1" />
                                </Grid>
                            </Border>
                        </Expander>
                        <Expander Grid.Row="1" Header="{x:Static p:Resources.LogFileOptionlbl}" IsExpanded="True">
                            <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Padding="10">
                                <Grid >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Margin="3.5" Name="textBlock2" 
                           Text="{x:Static p:Resources.FilePathlbl}" VerticalAlignment="Top" Grid.Column="0" OverridesDefaultStyle="False" />
                                    <TextBox Name="textBox2" Margin="3.5" MinWidth="200" VerticalAlignment="Top"
                                Text="{Binding Path=LogFilePath, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" OverridesDefaultStyle="False" />
                                    <Button Content="..." Name="button1" Command="{Binding Path=SpecifyLogFileCommand}" Grid.Column="2" Margin="3.5" VerticalAlignment="Top"  />
                                </Grid>
                            </Border>
                        </Expander>
                        <Expander Grid.Row="2" Header="{x:Static p:Resources.FontOptionslbl}" HorizontalAlignment="Left"
                          IsExpanded="True">
                            <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Padding="10">
                                <StackPanel Orientation="Horizontal">
                                    <ComboBox ItemsSource="{Binding Path=SystemFonts}" MinWidth="150" Margin="10"
                                  SelectedValue="{Binding Path=SelectedFont}" SelectedValuePath="Source" Width="150">
                                        <ComboBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <VirtualizingStackPanel/>
                                            </ItemsPanelTemplate>
                                        </ComboBox.ItemsPanel>
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding}" FontFamily="{Binding}"/>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                    </ComboBox>
                                    <ComboBox ItemsSource="{Binding Path=FontSizes}" SelectedValue="{Binding Path=FontSize}" Margin="10"
                                  SelectedItem="{Binding Path=FontSize}" Width="75" />
                                </StackPanel>
                            </Border>
                        </Expander>
                    </Grid>
                </StackPanel>
                
            </Border>
            <Border Grid.Column="1" BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Margin="3.5" Padding="10">
                <StackPanel>
                    <Grid >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Expander Grid.Row="0" Header="{x:Static p:Resources.BulkOutboxProcessingOptionslbl}" Margin="3.5"
                         IsExpanded="True">
                            <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Padding="10" >
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock HorizontalAlignment="Left" Margin="3.5" Name="textBlock3" 
                           Text="{x:Static p:Resources.BeforSubjectPrefix}" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" OverridesDefaultStyle="False" />
                                    <TextBox  HorizontalAlignment="Left" Name="textBox3" VerticalAlignment="Center" 
                         Text="{Binding Path=TextBeforOutboxSubject, UpdateSourceTrigger=PropertyChanged}" Width="Auto" Margin="3.5" Grid.Row="0" Grid.Column="1" MinWidth="250" OverridesDefaultStyle="False" />
                                    <TextBlock HorizontalAlignment="Left" Margin="3.5" Name="textBlock4" 
                           Text="{x:Static p:Resources.AfterSubjectPrefix}" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" OverridesDefaultStyle="False" />
                                    <TextBox  HorizontalAlignment="Left" Margin="3.5" Name="textBox4" 
                         Text="{Binding Path=TextAfterOutboxSubject, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Width="Auto" 
                         Grid.Column="1" Grid.Row="1" MinWidth="250" OverridesDefaultStyle="False" />
                                </Grid>
                            </Border>

                        </Expander>
                        <Expander  Grid.Row="1" Header="{x:Static p:Resources.BackgroundBrusheslbl}" IsExpanded="True" > 
                          
                            <Border BorderBrush="LightGray" BorderThickness="1" CornerRadius="10" Padding="10">
                                <ListBox ItemsSource="{Binding Backgrounds}">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate >
                                            <StackPanel Orientation="Horizontal"  HorizontalAlignment="Center" Background="{Binding Path=Item2}"
                                                        Margin="3">
                                                <RadioButton GroupName="brushes" IsThreeState="False" VerticalAlignment="Center"
                                                 DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=DataContext}"
                                                 Command="{Binding Path=BackgroundSelectionCommand}" CommandParameter="{Binding ElementName=BrushName, Path=Text}"/>
                                                <TextBlock x:Name="BrushName" Text="{Binding Path=Item1}" VerticalAlignment="Center" Height="50"
                                                           Width="150"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </Border>
                        </Expander>
                    </Grid>
                </StackPanel>
            </Border>

        </Grid>
        
    </DockPanel>


</UserControl>
